<template>
  <div class="container">
     <ul  v-show="commentList.length == '0' ? false : true">
       <li v-for="value in commentList" @click="go()">
         <img :src="value.from_userinfo.photo_url" class="headImg"/>
         <div class="details">
           <span>{{value.from_userinfo.nickname}}评论:{{value.content}}</span>
           <span>{{value.daka_info.title}}</span>
         </div>
         <div class="time">{{value.created_at}}</div>
       </li>
     </ul>

     <div class="noneDetail" v-show="commentList.length == '0' ? true : false">
           <span>暂无评论消息</span>
     </div>
</div>
</template>
<script>
export default {
  data () {
    return {
      commentList:""
  }
 },
  methods: {
   go(){
    wx.navigator({
      url:"../logs/main"
    })
   }
  },
  onLoad(){
    var _this=this;
    var userToken=wx.getStorageSync('userToken');
    wx.request({
      url:"https://daka.rzkeji.com/api/ucenter/get-message-list",
      data:{
        daka_token:userToken
      },
      methods:'GET',
      header:{
        "content-type":"application/json"
      },
      success(res){
        _this.commentList=res.data.data;
      }
    })
  }

}
</script>
<style scoped>
.container{width: 100%;height: 100%;background: #e4e4e4;}
.container ul{width: 100%;height: 100%;}
.container ul li{width: 100%;height: 70px;display: flex;position: relative;background: #fff;margin-bottom: 5px;margin-top: 5px;}
.headImg{width: 50px;height: 50px;border-radius: 50px;margin-top: 7px;}
.details{width: 250px;height: 50px;margin-top: 3px;margin-left: 5px;}
.details span{width: 100%;display: block;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;font-size: 16px;}
.details span:nth-of-type(2){width: 310px;}
.time{width: 130px;height: 17px;font-size: 13px;position: absolute;right: 0;bottom: 0;text-align: center;line-height: 17px;}

.noneDetail{width: 100%;height: 1px;text-align: center;padding:100px 0;}
.noneDetail span:nth-of-type(1){width: 100%;height: 30px;display: block;}
</style>
